﻿/* 
 * Copyright 2010 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License")
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Ngilead.Core.Store
{
    /// <summary>
    /// Store and restore interface
    /// </summary>
    public interface IProxyStore
    {
        /// <summary>
        /// Store the argument proxy informations.
        /// </summary>
        /// <param name="cloneBean">the cloned, target bean</param>
        /// <param name="persistentBean">the persistent, source bean</param>
        /// <param name="property">the proxy property name</param>
        /// <param name="proxyInformations">the associated proxy informations</param>
        void StoreProxyInformations(object cloneBean, object persistentBean,
                                    string property,
                                    Dictionary<string, Object> proxyInformations);

        /// <summary>
        /// Remove the proxy informations from the property of the argument object.
        /// </summary>
        /// <param name="obj">the root pojo</param>
        /// <param name="property">the proxy property name</param>
        void RemoveProxyInformations(object obj, string property);

        /// <summary>
        /// Get the proxy informations for the argument pojo and properties
        /// </summary>
        /// <param name="pojo">the root pojo</param>
        /// <param name="property">the proxy property name</param>
        /// <returns>the proxy informations if they exists, null otherwise</returns>
        Dictionary<string, Object> GetProxyInformations(object pojo, string property);


        /// <summary>
        /// Clean up the proxy store after a complete serialization process
        /// </summary>
        void CleanUp();
    }
}
